<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateShopInfoBusinTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_info_busin', function (Blueprint $table) {
            $table->increments('id');
            $table->string('code',255)->comment('商家代码');
            $table->string('name',255)->comment('商家名称');
            $table->string('logo',255)->comment('商家logo');
            $table->integer('first_class_id')->comment('一级分类id');
            $table->integer('second_class_id')->comment('二级分类id');
            $table->string('shop_label',255)->comment('标签');
            $table->integer('province_id')->comment('省份id');
            $table->integer('city_id')->comment('城市id');
            $table->integer('district_id')->comment('区县id');
            $table->integer('business_area_id')->comment('商圈id');
            $table->string('longitude',255)->comment('经度');
            $table->string('latitude',255)->comment('纬度');
            $table->integer('status',4)->comment('是否上架');
            $table->integer('is_new_shop',4)->default(1)->comment('是否为新店（1为新店、0默认）');
            $table->integer('browse_num')->default(1)->comment('浏览量（默认值为1，非空）');
            $table->integer('collect_num')->default(1)->comment('收藏量（默认为1，非空）');
            $table->string('grade',16)->comment('商家级别');
            $table->string('list_photo',128)->comment('列表展示图');
            $table->integer('is_event',4)->comment('今日是否是翻倍日（1:是翻倍日、0:不是翻倍日）');
            $table->date('next_event')->comment('下次活动日期');
            $table->string('first_class_name',255)->comment('一级分类名称');
            $table->string('second_class_name',255)->comment('二级分类名称');
            $table->string('city_name',255)->comment('城市名称');
            $table->string('address',255)->comment('详细地址');
            $table->string('district_name',255)->comment('区县名称');
            $table->string('business_area_name',255)->comment('商圈名称');
            $table->integer('order_number')->comment('订单数量');
            $table->integer('comment_number')->comment('评论数量');
            $table->decimal('comment_scores',16,2)->comment('评论总分数');
            $table->decimal('comment_mark',16,2)->default(5.00)->comment('评论分数（默认5分，非空）');
            $table->integer('maintainer_id')->comment('系统维护人id');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('shops_info_busin');
    }
}
